<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>锐信内容管理系统-修改栏目信息</title>
<%@include file="/WEB-INF/pages/common/taglibs.jsp"%>
<link rel="stylesheet" type="text/css" href="${ctx}resources/css/screen.css" />
<link rel="stylesheet" type="text/css" href="${ctx}resources/css/list.css" />
<script type="text/javascript" src="${ctx}resources/js/jquery.validate.min.js"></script>
<script type="text/javascript" src="${ctx}resources/js/jquery.uploadify-3.1.min.js"></script>
<link rel="stylesheet" type="text/css" href="${ctx}resources/css/uploadify.css" /> 
<style>
<!-- 	.sing {
	width: 200px;
	height: 25px;
}
input{
	border:#999 1px solid;
} -->
</style>
<script type="text/javascript">
$().ready(function() {
		$("#signupForm").validate({
			rules: {
				title: {
					required: true,
					minlength:2
				},
				description: {
					required: true
				}
			},
			messages: {
				title: {
					required: "*标题不能为空！",
					minlength:"*标题长度应该大于2个字符！"
				},
				description: {
					required: "*描述不能为空！"
				}
			}
		});

	   $('#uploadify').uploadify({
	   	 'formData': {'id':"${digital.id}",'uploader':'digitallogo'},
	       'swf': '${ctx}resources/js/uploadify.swf',
	       'method':'post',
	       'buttonText':'上传',
	       'fileObjName':'attachment',
	       'uploader':'${ctx}attach/pic/upload.htm;jsessionid=${sessionId}',
	       'onUploadError': function(a, b, c, d){
	       	alert("上传失败");
	       },'onUploadSuccess' : function(file, data, response) {
	           $("#logo").val(data);
	           $("#imgs").attr('src',"${ctx}"+data); 
	       }
	   });
	});
	</script>
</head>
<body>
<div align="center" style="padding-top:20px;">
  <form  id="signupForm" method="post" action="${ctx}digital/save.htm">
	<input type="hidden" value="${digital.id}" name="id">
	<input type="hidden" value="${digital.pid}" name="pid">
	<input type="hidden" value="${digital.logo}" name="logo" id="logo">
		<table width="95%" cellpadding="0" cellspacing="1" align="center" id="bordertable">
		<tr height="30px;"  class="tr0">
			<td width="40%" style="  text-align: right;"><label>标题:</label></td>
			<td><input name="title" type="text" value="${digital.title}" id="title" class="sing"></td>
		</tr>
		<tr height="30px;"  class="tr0">
			<td  style="  text-align: right;"><label>积分:</label></td>
			<td ><input name="integral" value="${digital.integral}" class="sing"></td>
		</tr>
		 <tr class="tr0" height="40">
        <td style="  text-align: right;"><label>节点LOGO:</label>
        </td>
        <td width="60%">
        	<div><img alt="该节点还没有LOGO" id="imgs" src=" ${ctx}${digital.logo}" style="width: 100px;height: 100px;"/><input type="file" name="attachment" id="uploadify"/></div>
		</td>
      </tr>
		<tr height="30px;"  class="tr0">
			<td  style="  text-align: right;"><label>类型:</label></td>
			<td><select name="digitalType" style="width:100px;height: 24px;">
				<option  value="0" ${digital.digitalType eq "0"?"selected":""}>栏目</option>
				<option  value="1" ${digital.digitalType eq "1"?"selected":""}>数据</option>
			</select></td>
		</tr>
		<tr height="30px;"  class="tr0">
			<td  style="  text-align: right"><label>状态:</label></td>
			<td><select name="status" style="height: 24px;width:100px">
				<option  value="1" ${digital.status?"selected":""}>上线</option>
				<option  value="0" ${digital.status ?"":"selected"}>下线</option>
			</select></td>
		</tr>
		<tr height="30px;"  class="tr0">
			<td  style="padding-right: 50px;text-align: right;"><label>正文:</label></td>
			<td ><textarea name="textContent"  rows="5" cols="50">${digital.textContent}</textarea></td>
		</tr>
		<tr height="30px;"  class="tr0">
			<td  style="padding-right: 50px;text-align: right;"><label>描述:</label></td>
			<td ><textarea name="description"  rows="5" cols="50">${digital.description}</textarea></td>
		</tr>
		<tr height="70px;"  class="tr0">
			<td style="padding-right: 20px;text-align: right; height:50px;"><input class="button" type="submit" value="提交"/></td>
			<td style="padding-left: 20px;text-align: left; height:50px;"><input class="button"  type="reset" value="取消" onclick="javascript:history.back();"/></td>
		</tr>
		</table>
</form>
</div>
</body>
</html>